package com.jiuyun.dao;

import com.jiuyun.entity.Book;
import com.jiuyun.entity.Question;

import java.sql.SQLException;
import java.util.List;

public interface BookDao {
    //查询所有题库
    List<Book> allbook() throws SQLException;

    //根据题库名查题目  page页数
    List<Question> alltimu(int page, String bookname) throws SQLException;

    //返回总行数
    int count(String bookname) throws SQLException;

    //添加题库
    int addbook(Book book) throws SQLException;

    //修改题库名称
    int upd_bookname(String bookname, int bookid) throws SQLException;

    //根据题库名查题库id
    int findbookid(String bookname) throws SQLException;

    //删除题库
    int delbook(int bookid) throws SQLException;

    //删除题目
    int deltimu(int qid) throws SQLException;

    //添加试题
    int addtimu(Question question) throws SQLException;

    //根据题目id查题目
    List<Question> findtimu(int qid) throws SQLException;

    //根据题目id修改题目
    int updtimu(Question q) throws SQLException;

}
